//
//  ZXBaseViewController.h
//  MortgageHelper
//
//  Created by apple on 16/6/28.
//  Copyright © 2016年 zhangxiang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MGConstFile.h"

#import "UIViewController+Tips.h"


@interface ZXBaseViewController : UIViewController

@property (nonatomic, assign) BOOL hideDefaultBackButton;  // 隐藏默认返回按钮
@property (nonatomic, assign) BOOL removeFromNavigationStackWhenDisappered; // 页面消失的时候从导航控制器栈中移除
@property (nonatomic, assign) BOOL firstEnter;           // 判断是否为第一次进入该页面  而不是从其他页面返回

-(instancetype)initWithSelfClassNib;

/**
 *  检查是否登录
 *
 *  @return YES: 已登录   NO: 没登录(跳转到登录页面)
 */
- (BOOL)checkIsLogin;

- (UIBarButtonItem *)leftBarButtonItem:(UIView *)leftButton;

/// 设置导航栏右按钮
- (UIBarButtonItem *)rightBarButtonWithName:(NSString *)name
                                  imageName:(NSString *)imageName
                                     target:(id)target
                                     action:(SEL)action;

- (UIBarButtonItem *)rightBarButtonWithName:(NSString *)name
                                  imageName:(NSString *)imageName
                                  textColor:(UIColor *)textColor
                                     target:(id)target
                                     action:(SEL)action;
// 导航条左侧按钮事件
- (void)goBackClick;

#pragma mark  将当前控制器从导航控制器栈中移除

- (void)removeFromNavigationControllerStack;
- (void)removeControllerFromIndex:(NSInteger )index;

// 网络重新加载
-(void)showNetworkMessage:(NSString *)message error:(NSError *)error;
-(void)tryAgianLoadData; // 子类重写重刷数据

@end
